package com.kymatrix.mpo.plus.bpm.server.controller.task;

import com.kymatrix.mpo.plus.bpm.server.model.form.activity.QueryBpmActivityResp;
import com.kymatrix.mpo.plus.bpm.server.service.BpmActivityService;
import com.kymatrix.mpo.plus.common.business.common.ResultResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "BPM 流程活动实例相关请求处理类")
@RestController
@Validated
public class BpmActivityController {

    @Resource
    private BpmActivityService activityService;

    @GetMapping("/bpm/activity/list")
    @ApiOperation(value = "生成指定流程实例的高亮流程图",
            notes = "只高亮进行中的任务。不过要注意，该接口暂时没用，通过前端的 ProcessViewer.vue 界面的 highlightDiagram 方法生成")
    public ResultResp<List<QueryBpmActivityResp>> getActivityList(
            @RequestParam("processInstanceId") String processInstanceId) {
        return ResultResp.ok(activityService.getActivityListByProcessInstanceId(processInstanceId));
    }
}
